
# Cardano Example Dapp

## **Cryptographic Functions**

This demo will test and explore cryptographic functions


## Try it online: 

-  Visit [HTML+JS Dapp](https://gamechangerfinance.github.io/gamechanger.wallet/examples/Cryptographic%20Functions.html)
-  Visit [HTML+React Dapp](https://gamechangerfinance.github.io/gamechanger.wallet/examples/Cryptographic%20Functions_react.html)
-  Visit [Native HTML dapp](https://gamechangerfinance.github.io/gamechanger.wallet/examples/Cryptographic%20Functions_nolib.html)
-  Run [Standalone URL dapp connection](https://wallet.gamechanger.finance/api/2/run/1-H4sIAAAAAAAAA42S0UrDMBSGXyXkZh1s6zaZSO_mRL3wQmTipRzTrAmkTUhOcaX0Rbzz1XwSk67OObbiVU_Id_7zndCaokTFaUJXtjKoMwtGSEZuy4Kh1IWjI5pyx6w04ei5tZCOpDzX5F0qRZA7JFCkhG-N0pYT9idnc5CDlQmDdmH-DDZzNKlpzp2DjI9RjwU44ZGvj09ytyIvoBRH2oyoD9cWl27veeMFfITlWNri-enhERC5DX4C0SRxrDQDJbTD5GI6ncZBOAYj4xSMCY1lEUYbqJSGNJSdXQ7M6h-A1hnHaBBEJ0eWg2ETxN4q_wDn2wXfrvW1Z5bWQhU5tGt9z7dRG8uACT7pFAbD4S6xdLLIXkvcXJ2LrakTsJjNw4BddTqv8Q3-fr647Ehf9ZKzjpudp_J0ESD_Occ0-x1636Z_ibb1HysccScXOGRO6_8SrXwpe36IcBu1ZPMNGxBaFjwDAAA)

## Source code:

- dapp connection code: [GCScript DSL](Cryptographic%20Functions.gcscript)
- frontend (using @gamechanger-finance/gc): [HTML+JS dapp](Cryptographic%20Functions.html)
- frontend (using @gamechanger-finance/gc): [HTML+React dapp](Cryptographic%20Functions_react.html)
- frontend (without official library): [Native HTML dapp](Cryptographic%20Functions_nolib.html)

Dapp code was autogenerated by [Playground IDE in GameChanger Wallet ](https://wallet.gamechanger.finance/playground)

## GCScript code (dapp connection):
```json
{
  "title": "Cryptographic Functions",
  "description": "This demo will test and explore cryptographic functions",
  "type": "script",
  "args": {
    "message-to-hash": "⚡ GC Wallet"
  },
  "exportAs": "CryptoDemo",
  "returnURLPattern": "http://localhost:3000/demo/api/dapp",
  "run": {
    "payload": {
      "type": "macro",
      "run": "{get('args.message-to-hash')}"
    },
    "bytes": {
      "type": "macro",
      "run": "{hexToByteArray(strToHex(get('cache.payload')))}"
    },
    "using_utf8": {
      "type": "macro",
      "run": {
        "sha512": "{sha512(get('cache.payload'))}",
        "sha256": "{sha256(get('cache.payload'))}",
        "sha1": "{sha1(get('cache.payload'))}",
        "md5": "{md5(get('cache.payload'))}"
      }
    },
    "using_bytes": {
      "type": "macro",
      "run": {
        "sha512": "{sha512(get('cache.bytes'))}",
        "sha256": "{sha256(get('cache.bytes'))}",
        "sha1": "{sha1(get('cache.bytes'))}",
        "md5": "{md5(get('cache.bytes'))}"
      }
    },
    "uuid": {
      "type": "macro",
      "run": "{uuid()}"
    }
  }
}
```

## Run standalone QR dapp connection: 

You can use [Playground IDE in GameChanger Wallet ](https://wallet.gamechanger.finance/playground) in `QR URL Transport` mode to capture results

[![This GCScript/URL is too large! make it shorter uploading parts to GCFS. Unable to generate QR code](Cryptographic%20Functions.png)](https://gamechangerfinance.github.io/gamechanger.wallet/examples/Cryptographic%20Functions.png)

## Resources
- [How to connect?](https://www.npmjs.com/package/@gamechanger-finance/gc)
- [Docs and examples on Github](https://github.com/GameChangerFinance/gamechanger.wallet/)
- [GCScript documentation](https://wallet.gamechanger.finance/doc/api/v2)
- [Playground IDE in GameChanger Wallet ](https://wallet.gamechanger.finance/playground)
- [Tutorials on Youtube](https://www.youtube.com/@gamechanger.finance)
- [Support on Discord](https://discord.gg/vpbfyRaDKG)
- [News on Twitter](https://twitter.com/GameChangerOk)
- [Website](https://gamechanger.finance)

## License
MIT 
    
