Skip to content

Commit

Permalink
feat(crypto): add Hash28ByteBase16.fromEd25519KeyHashHex
Browse files Browse the repository at this point in the history
  • Loading branch information
mkazlauskas committed Aug 8, 2023
1 parent 0d3dc02 commit baf45d6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/crypto/src/hexTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,7 @@ export type Hash28ByteBase16 = OpaqueString<'Hash28ByteBase16'>;
* @throws InvalidStringError
*/
export const Hash28ByteBase16 = (value: string): Hash28ByteBase16 => typedHex<Hash28ByteBase16>(value, 56);
/**
* Ed25519KeyHashHex is a 28 byte hash. This is a utility function that downcasts without validation.
*/
Hash28ByteBase16.fromEd25519KeyHashHex = (value: Ed25519KeyHashHex) => value as unknown as Hash28ByteBase16;

0 comments on commit baf45d6

Please sign in to comment.