mirror of
https://github.com/Raghu-Ch/angular-challenges.git
synced 2026-02-10 12:53:03 -05:00
feat: test auth
This commit is contained in:
15
docs/src/utils/encrypt.ts
Normal file
15
docs/src/utils/encrypt.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
export function toHexString(value: string): string {
|
||||
return value
|
||||
.split('')
|
||||
.map((c) => c.charCodeAt(0).toString(16).padStart(2, '0'))
|
||||
.join('');
|
||||
}
|
||||
|
||||
export function fromHexString(hexString: string): string {
|
||||
return (
|
||||
hexString
|
||||
.match(/.{1,2}/g)
|
||||
?.map((byte) => String.fromCharCode(parseInt(byte, 16)))
|
||||
.join('') ?? ''
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user