hash over http
This commit is contained in:
@@ -5,6 +5,7 @@ import { Auth, User, _Class, FrontcraftFeatureIfc, SomeOf, FrontcraftIfc, } from
|
|||||||
import { CookieService } from 'ngx-cookie-service';
|
import { CookieService } from 'ngx-cookie-service';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { ShoutMessage } from '../../../../../backend/Components/Shoutbox/Interface';
|
import { ShoutMessage } from '../../../../../backend/Components/Shoutbox/Interface';
|
||||||
|
import { saltedHash } from '../../../../../backend/Util/hash';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class ApiService{
|
export class ApiService{
|
||||||
@@ -142,9 +143,7 @@ function buf2hex(buffer: ArrayBuffer) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function hash(value:string) : Promise<string>{
|
export async function hash(value:string) : Promise<string>{
|
||||||
const buf = str2arraybuf(value)
|
return saltedHash(value, "")
|
||||||
const pwHash = await crypto.subtle.digest('SHA-256', buf);
|
|
||||||
return buf2hex(pwHash)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//angular depenency manager requires this
|
//angular depenency manager requires this
|
||||||
|
|||||||
Reference in New Issue
Block a user