@credo-ts/core
Version:
<p align="center"> <br /> <img alt="Credo Logo" src="https://github.com/openwallet-foundation/credo-ts/blob/c7886cb8377ceb8ee4efe8d264211e561a75072d/images/credo-logo.png" height="250px" /> </p> <h1 align="center"><b>Credo - Core</b></h1
1 lines • 1.07 kB
Source Map (JSON)
{"version":3,"file":"CredoSha1Provider.mjs","names":[],"sources":["../../../../src/crypto/webcrypto/providers/CredoSha1Provider.ts"],"sourcesContent":["import * as core from 'webcrypto-core'\nimport { Sha1 } from '../../hashes'\nimport type { HashAlgorithm } from '../types'\n\nexport class CredoSha1Provider extends core.ProviderCrypto {\n public name = 'SHA-1'\n public usages = []\n\n public override async onDigest(algorithm: HashAlgorithm, data: ArrayBuffer): Promise<ArrayBuffer> {\n switch (algorithm.name.toUpperCase()) {\n case 'SHA-1': {\n const hash = new Sha1().hash(new Uint8Array(data))\n return hash.buffer as ArrayBuffer\n }\n default:\n throw new Error(`Hashing algorithm: ${JSON.stringify(algorithm)} is not supported`)\n }\n }\n}\n"],"mappings":";;;;;;;AAIA,IAAa,oBAAb,cAAuC,KAAK,eAAe;;;OAClD,OAAO;OACP,SAAS,EAAE;;CAElB,MAAsB,SAAS,WAA0B,MAAyC;AAChG,UAAQ,UAAU,KAAK,aAAa,EAApC;GACE,KAAK,QAEH,QADa,IAAI,MAAM,CAAC,KAAK,IAAI,WAAW,KAAK,CAAC,CACtC;GAEd,QACE,OAAM,IAAI,MAAM,sBAAsB,KAAK,UAAU,UAAU,CAAC,mBAAmB"}