@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.11 kB
Source Map (JSON)
{"version":3,"file":"did.mjs","names":[],"sources":["../../src/utils/did.ts"],"sourcesContent":["import { TypedArrayEncoder } from './TypedArrayEncoder'\n\nexport function indyDidFromPublicKeyBase58(publicKeyBase58: string): string {\n const buffer = TypedArrayEncoder.fromBase58(publicKeyBase58)\n\n const did = TypedArrayEncoder.toBase58(buffer.slice(0, 16))\n\n return did\n}\n\n/**\n * Checks whether `potentialDid` is a valid DID. You can optionally provide a `method` to\n * check whether the did is for that specific method.\n *\n * Note: the check in this method is very simple and just check whether the did starts with\n * `did:` or `did:<method>:`. It does not do an advanced regex check on the did.\n */\nexport function isDid(potentialDid: string, method?: string) {\n return method ? potentialDid.startsWith(`did:${method}:`) : potentialDid.startsWith('did:')\n}\n"],"mappings":";;AAEA,SAAgB,2BAA2B,iBAAiC;CAC1E,MAAM,SAAS,kBAAkB,WAAW,eAAe;CAI3D,OAFY,kBAAkB,SAAS,OAAO,MAAM,GAAG,EAAE,CAEhD;AACX;;;;;;;;AASA,SAAgB,MAAM,cAAsB,QAAiB;CAC3D,OAAO,SAAS,aAAa,WAAW,OAAO,OAAO,EAAE,IAAI,aAAa,WAAW,MAAM;AAC5F"}