Hash::make (method)

Return to Knowledgebase

Purpose

Creates an SHA-256 hash (optionally salted hash) from a string

Location

users/classes/Hash.php

Parameters

This function does not take any arguments

Example

Hash::make("Testing 123", $salt = 'abc');

Further Documentation:

Please note that hashing is not the same as encrypting. This creates a deterministic hash, which means that whatever you hash will always have the same result. This makes it a bad idea to use this for passwords. It is more often used for making sure things are identical.

In other words, if user 1 hashes a file and gets the same result as user 2, you are able to determine with confidence that the file did not change between user 1 and user 2 viewing it.