mirror of
https://github.com/status-im/status-go.git
synced 2025-01-10 22:56:40 +00:00
dcaf8caed0
* Add x3dh key exchange * Encrypt using the double ratchet * Multi device with auto-pairing * Add pfs enabled flag
16 lines
371 B
Go
16 lines
371 B
Go
package database
|
|
|
|
import (
|
|
"fmt"
|
|
"hash/crc32"
|
|
)
|
|
|
|
const advisoryLockIdSalt uint = 1486364155
|
|
|
|
// GenerateAdvisoryLockId inspired by rails migrations, see https://goo.gl/8o9bCT
|
|
func GenerateAdvisoryLockId(databaseName string) (string, error) {
|
|
sum := crc32.ChecksumIEEE([]byte(databaseName))
|
|
sum = sum * uint32(advisoryLockIdSalt)
|
|
return fmt.Sprintf("%v", sum), nil
|
|
}
|