@hazae41/ripemd160
Version:
RIPEMD-160 adapter for WebAssembly and JS implementations
1 lines • 962 B
Source Map (JSON)
{"version":3,"file":"adapter.mjs","sources":["../../../../../src/mods/ripemd160/adapter.ts"],"sourcesContent":["import { None, Nullable, Option } from \"@hazae41/option\"\nimport { BytesOrCopiable, Copiable } from \"libs/copiable/index.js\"\n\nlet global: Option<Adapter> = new None()\n\nexport function get() {\n return global\n}\n\nexport function set(value: Nullable<Adapter>) {\n global = Option.wrap(value)\n}\n\nexport interface Hasher extends Disposable {\n cloneOrThrow(): Hasher\n\n updateOrThrow(bytes: BytesOrCopiable): this\n\n finalizeOrThrow(): Copiable\n}\n\nexport interface HasherFactory {\n createOrThrow(): Hasher\n}\n\nexport interface Adapter {\n readonly Hasher: HasherFactory\n\n hashOrThrow(bytes: BytesOrCopiable): Copiable\n}\n\n"],"names":[],"mappings":";;AAGA,IAAI,MAAM,GAAoB,IAAI,IAAI,EAAE;SAExB,GAAG,GAAA;AACjB,IAAA,OAAO,MAAM;AACf;AAEM,SAAU,GAAG,CAAC,KAAwB,EAAA;AAC1C,IAAA,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;AAC7B;;;;"}