Implemented SHA256 hash helper function
This commit is contained in:
		
							parent
							
								
									e49a652afa
								
							
						
					
					
						commit
						a5e750eae7
					
				
					 1 changed files with 10 additions and 0 deletions
				
			
		
							
								
								
									
										10
									
								
								lib/sha256.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								lib/sha256.ts
									
									
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,10 @@ | |||
| const crypto = require('crypto'); | ||||
| 
 | ||||
| function sha256(input: string): string { | ||||
|   return crypto | ||||
|       .createHash('sha256') | ||||
|       .update(input) | ||||
|       .digest("hex"); | ||||
| } | ||||
| 
 | ||||
| export default sha256; | ||||
		Loading…
	
		Reference in a new issue
	
	 nicolas
						nicolas