hash over http

This commit is contained in:
peter
2020-02-05 18:02:21 +01:00
parent 8c0e36e6f7
commit b01a06fa10
@@ -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