Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@lismore
Created June 6, 2018 11:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lismore/c4f11e5f87e63b3a9f7dc1cd9043fc9b to your computer and use it in GitHub Desktop.
Save lismore/c4f11e5f87e63b3a9f7dc1cd9043fc9b to your computer and use it in GitHub Desktop.
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.24+commit.e67f0147.js&optimize=false&gist=
pragma solidity ^0.4.0;
contract AudioAuthenticity {
string constant wavehash = "dea7db275ee984f7f4bf0e2b5ba77aa428e780ca5fda49435960c7fef1b4b94b";
string constant mp3hash = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";
function checkMp3VersionHash(string hashInput)public returns(bool){
bool result = compareHashes(hashInput, mp3hash);
return result;
}
function compareHashes (string a, string b) private view returns (bool){
return keccak256(a) == keccak256(b);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment