feat(hash-text): digest base selector (#254)

This commit is contained in:
Corentin THOMASSET 2022-08-03 17:16:03 +02:00 committed by GitHub
parent fad4833ca2
commit 422b6eb05a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 62 additions and 7 deletions

View file

@ -0,0 +1,7 @@
export function convertHexToBin(hex: string) {
return hex
.trim()
.split('')
.map((byte) => parseInt(byte, 16).toString(2).padStart(4, '0'))
.join('');
}