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

API Design #5

Open
flytzen opened this issue Jul 11, 2022 · 0 comments
Open

API Design #5

flytzen opened this issue Jul 11, 2022 · 0 comments

Comments

@flytzen
Copy link
Member

flytzen commented Jul 11, 2022

The API should be similar to the following:

public Encryptor Encrypt(string data, Encoding ...);
public Encryptor Encrypt(byte[] data);
public Encryptor Encrypt(ReadOnlySpan<byte> data);
public Encryptor Encrypt(Stream data);

the Encryptor object would then have methods similar to the following:

public string ToBase64String();
public byte ToByteArray();
public Memory<Byte> ToMemory(); ????
public void ToStream(Stream output);

...and similar for decryption.
Should give it a nice, clean API without having to worry about all the conversions and all that.

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

No branches or pull requests

1 participant