cosmjs-util/packages/crypto/src/utils.ts
2022-01-26 21:33:20 +01:00

6 lines
240 B
TypeScript

// See https://github.com/paulmillr/noble-hashes/issues/25 for why this is needed
export function toRealUint8Array(data: ArrayLike<number>): Uint8Array {
if (data instanceof Uint8Array) return data;
else return Uint8Array.from(data);
}