Crypto Zombies Lesson 1 ,Ch11 Keccak256 and Typecasting, Solidity Programming

Channel:
Subscribers:
8,020
Published on ● Video Link: https://www.youtube.com/watch?v=o8Wj0AfOk0c



Duration: 4:07
1,257 views
18


In chapter 11 of Crypto Zombies we are looking at the Keccak256 hash function. A hash function maps a string into a pretty random 256-bit hexidecimal number. This will allow us to create our zombie DNA. In this challenge we take our _str variable and throw it into the Keccak256 function and store it in a variable named rand. We make sure to typecast the _str to a uint. Once we do that and have the result stored in rand we then return rand % dnaModulus. Typecasting allows us to convert between datatypes since strings sometimes store numbers we might want to do math with those numbers later and would have to convert our string to an number to be able to do math with it.




Other Videos By We Will Code


2018-05-02Crypto Zombies, Chapter 2 Overview,Solidity Programming
2018-05-02Codecademy Learn Java, HashMap Access, Accessing a HashMap
2018-04-28Crypto Zombies Lesson 1 ,Ch14 Web3.js, Solidity Events
2018-04-28Codecademy Learn Java, HashMap, 2018 Programming
2018-04-28Crypto Zombies Lesson 1, Ch13 Events, Solidity Events
2018-04-27Codecademy Learn Java, For Each Loop, Programming in 2018
2018-04-26Conceptos Basicos de HTML, Imagenes y Enlaces, Aprende,
2018-04-25Codecademy Learn Java, Iterating over an ArrayList
2018-04-24Crypto Zombies Lesson 1 ,Ch12 Putting It Together, Solidity Tutorial
2018-04-23Codecademy Learn Java, ArrayList Insertion, Data Structures
2018-04-23Crypto Zombies Lesson 1 ,Ch11 Keccak256 and Typecasting, Solidity Programming
2018-04-22Crypto Zombies Lesson 1 ,Ch10 More on Functions, Solidity Pure Vs View Function
2018-04-22Crypto Zombies Lesson 1 ,Ch9 Private Public Functions
2018-04-22Crypto Zombies Lesson 1 ,Ch8 Working With Structs and Arrays
2018-04-22Crypto Zombies ,Ch7 Function Declarations, Solidity Programming Language
2018-04-21Crypto Zombies ,Ch6 Arrays, Arrays in Solidity, Fixed Array, Dynamic Array
2018-04-21Crypto Zombies ,Ch5 Structs,Learn Solidity Structures
2018-04-20Crypto Zombies ,Ch4 Math Operations, Learn Solidity 2018
2018-04-20Crypto Zombies ,Ch3 State Variables & Integers, Declare & Initialize Solidity Variable
2018-04-19Crypto Zombies ,Ch2 Contracts,Learn Ethereum Blockchain
2018-04-19Crypto Zombies ,Ch1 Lesson Overview,Learn Ethereum Blockchain



Tags:
solidity functions
crypto zombies tutorial
solidity programming language
solidity typecasting