MCPcopy Create free account
hub / github.com/FuAdmin/fu-admin / SHA512Hashing

Class SHA512Hashing

web/src/utils/cipher.ts:118–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

116
117// Define a singleton class for SHA512 Hashing
118class SHA512Hashing implements Hashing {
119 private static instance: SHA512Hashing;
120
121 private constructor() {}
122
123 // Get the singleton instance
124 // 获取单例实例
125 public static getInstance(): SHA256Hashing {
126 if (!SHA512Hashing.instance) {
127 SHA512Hashing.instance = new SHA512Hashing();
128 }
129 return SHA512Hashing.instance;
130 }
131
132 hash(plainText: string) {
133 return SHA512(plainText).toString();
134 }
135}
136
137export class EncryptionFactory {
138 public static createAesEncryption(params: EncryptionParams): Encryption {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected