Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow user defined encodings. #2

Closed
wants to merge 1 commit into from
Closed

Allow user defined encodings. #2

wants to merge 1 commit into from

Conversation

rustyconover
Copy link

Add encode_with_encoding and decode_with_encoding which
allow the user to use pluggable encodings rather than just MIME::Base64.

Change encode and decode to just specify their encoding functions based
on MIME::Base64.

Add encode_with_encoding and decode_with_encoding which
allow the user to use pluggable encodings rather than just MIME::Base64.

Change encode and decode to just specify their encoding functions based
on MIME::Base64.
@dagolden
Copy link
Collaborator

What do you think about just extending encode and decode to take arguments and avoiding method calls to encode_with_encoding etc? E.g.

$store->encode( $data, $expires, $encoding_function )

where $encoding_function is set to the default if not defined?

David

@dagolden
Copy link
Collaborator

My next question is whether this really needs to be per-invocation of encode/decode or whether they should be properties of the object itself.

Could you please tell me a bit more about why you want this customization and what you're trying to do?

Thanks.

@rustyconover
Copy link
Author

Hi David,

I'm using Session::Storage::Secure to create a string that is used as part of a custom reply to address for an email that I'm sending. When a user replies to that address, I decode the data that I stored in the address and then I know how to process their reply, rather than exposing that information in plain text in the email address or having a separate lookup table.

MIME::Base64 uses characters that aren't permissible in email addresses and it also distinguishes from upper and lower case. Whereas MIME::Base32 works perfectly for my needs and shares a very close to the same interface.

Thanks,

Rusty

@dagolden
Copy link
Collaborator

Makes sense. I'll implement this as attributes instead of as method arguments.

@rustyconover
Copy link
Author

I’m happy to do that too if you want…

Rusty

-- 
Rusty Conover
Lucky Dinosaur, LLC.

On April 17, 2014 at 1:02:07 PM, David Golden (notifications@github.com) wrote:

Makes sense. I'll implement this as attributes instead of as method arguments.


Reply to this email directly or view it on GitHub.

@dagolden
Copy link
Collaborator

I'll do it. It's not a lot of work, but I might rename some stuff in the process.

@dagolden
Copy link
Collaborator

Shipped to CPAN. I also added the ability to change separator character, which you might also need.

@dagolden dagolden closed this Apr 17, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants