diff --git a/README.md b/README.md index 79452b8..ae61bcf 100644 --- a/README.md +++ b/README.md @@ -97,6 +97,13 @@ POST /generic/time-from-epoch +## References + +- [Bitcoin White Paper](https://bitcoin.org/bitcoin.pdf) +- [bitcoin.org](https://bitcoin.org/en/) +- [Mastering Bitcoin: Unlocking Digital Crypto-Currencies, Andreas M. Antonopoulos](https://bitcoinbook.info/) + + ## Todos - Complete APIs' Todos diff --git a/src/main/scala/com/github/fluency03/blockchain/package.scala b/src/main/scala/com/github/fluency03/blockchain/package.scala index e0ab759..b8af251 100644 --- a/src/main/scala/com/github/fluency03/blockchain/package.scala +++ b/src/main/scala/com/github/fluency03/blockchain/package.scala @@ -17,6 +17,10 @@ package object blockchain { type Bytes = Array[Byte] type UTXO = (TxIn, TxOut) + type Hex = String + type Binary = String + type Base64 = String + type Base58 = String implicit val formats: AnyRef with Formats = Serialization.formats(NoTypeHints) @@ -40,7 +44,7 @@ package object blockchain { implicit class StringImplicit(val str: String) { def hex2Long: Long = java.lang.Long.parseLong(str, 16) def hex2BigInt: BigInt = BigInt(str, 16) - def hex2Bytes: Array[Byte] = Hex.decode(str) + def hex2Bytes: Bytes = Hex.decode(str) def hex2Binary: String = binaryOfHex(str) def toBase64: String = base64Of(str.getBytes) def toSha256: String = SHA256.hash(str)