feat: major code refactor, add login and register endpoints with swagger
All checks were successful
Update changelog / changelog (push) Successful in 27s
All checks were successful
Update changelog / changelog (push) Successful in 27s
This commit is contained in:
13
src/tools/hasher.ts
Normal file
13
src/tools/hasher.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
// Credits:
|
||||
// https://mojoauth.com/hashing/sha-512-in-typescript/
|
||||
import { createHash } from 'crypto';
|
||||
/**
|
||||
* Generates a SHA-512 hash for the given input string.
|
||||
* @param input - The input string to hash.
|
||||
* @returns The SHA-512 hash as a hexadecimal string.
|
||||
*/
|
||||
export function generateSha512(input: string): string {
|
||||
const hash = createHash('sha512');
|
||||
hash.update(input);
|
||||
return hash.digest('hex');
|
||||
}
|
||||
Reference in New Issue
Block a user