added new crypto function toHex
This commit is contained in:
parent
687b68a11f
commit
d674717cb0
|
@ -361,3 +361,7 @@ export async function fromString(input: string) {
|
||||||
await sodium.ready;
|
await sodium.ready;
|
||||||
return sodium.from_string(input);
|
return sodium.from_string(input);
|
||||||
}
|
}
|
||||||
|
export async function toHex(input: string) {
|
||||||
|
await sodium.ready;
|
||||||
|
return sodium.to_hex(input);
|
||||||
|
}
|
||||||
|
|
|
@ -131,6 +131,9 @@ export class Crypto {
|
||||||
async fromB64(string) {
|
async fromB64(string) {
|
||||||
return libsodium.fromB64(string);
|
return libsodium.fromB64(string);
|
||||||
}
|
}
|
||||||
|
async toHex(string) {
|
||||||
|
return libsodium.toHex(string);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Comlink.expose(Crypto);
|
Comlink.expose(Crypto);
|
||||||
|
|
Loading…
Reference in a new issue