func PasswordCheck(secret string, password string) error {
	// No password set
	if secret == "" {
		return fmt.Errorf("No password is set")
	}

	// Compare the password
	buff, err := hex.DecodeString(secret)
	if err != nil {
		return err
	}

	salt := buff[0:32]
	hash, err := scrypt.Key([]byte(password), salt, 1<<14, 8, 1, 64)
	if err != nil {
		return err
	}

	if !bytes.Equal(hash, buff[32:]) {
		return fmt.Errorf("Bad password provided")
	}

	return nil
}
func PasswordCheck(secret string, password string) error {
	
	if secret == "" {
		return fmt.Errorf("No password is set")
	}

	
	buff, err := hex.DecodeString(secret)
	if err != nil {
		return err
	}

	salt := buff[0:32]
	hash, err := scrypt.Key([]byte(password), salt, 1<<14, 8, 1, 64)
	if err != nil {
		return err
	}

	if !bytes.Equal(hash, buff[32:]) {
		return fmt.Errorf("Bad password provided")
	}

	return nil
}
func PasswordCheck ( secret string , password string ) error { // No password set if secret == " " { return fmt . Errorf ( " " ) } // Compare the password buff , err := hex . DecodeString ( secret ) if err != nil { return err } salt := buff [ 0 : 32 ] hash , err := scrypt . Key ( [ ] byte ( password ) , salt , 1 << 14 , 8 , 1 , 64 ) if err != nil { return err } if ! bytes . Equal ( hash , buff [ 32 : ] ) { return fmt . Errorf ( " " ) } return nil }
// PasswordCheck validates the provided password against the encoded secret
PasswordCheck validates the provided password against the encoded secret