File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
packages/testcontainers/src/common Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 11import { hash } from "./hash" ;
22
3- test ( "should return a hash" , ( ) => {
3+ test ( "should return a consistent hash" , ( ) => {
44 const str = "Hello, world!" ;
55
6- expect ( hash ( str ) ) . toBe ( "6cd3556deb0da54bca060b4c39479839 " ) ;
7- expect ( hash ( str ) ) . toBe ( "6cd3556deb0da54bca060b4c39479839 " ) ;
6+ expect ( hash ( str ) ) . toBe ( "315f5bdb76d078c43b8ac0064e4a0164612b1fce77c869345bfc94c75894edd3 " ) ;
7+ expect ( hash ( str ) ) . toBe ( "315f5bdb76d078c43b8ac0064e4a0164612b1fce77c869345bfc94c75894edd3 " ) ;
88} ) ;
Original file line number Diff line number Diff line change 11import crypto from "crypto" ;
22
33export function hash ( str : string ) : string {
4- return crypto . createHash ( "md5 " ) . update ( str ) . digest ( "hex" ) ;
4+ return crypto . createHash ( "sha256 " ) . update ( str ) . digest ( "hex" ) ;
55}
You can’t perform that action at this time.
0 commit comments