Course Hive
Search

Welcome

Sign in or create your account

Continue with Google
or
Crypto Zombies Lesson 1 ,Ch11 Keccak256 and Typecasting, Solidity Programming
Play lesson

Crypto Zombies Tutorial (Intro to Solidity) - Crypto Zombies Lesson 1 ,Ch11 Keccak256 and Typecasting, Solidity Programming

4.0 (3)
22 learners

What you'll learn

This course includes

  • 1.3 hours of video
  • Certificate of completion
  • Access on mobile and TV

Summary

Keywords

Full Transcript

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.

Course Hive

Continue this lesson in the app

Install CourseHive on Android or iOS to keep learning while you move.

Related Courses

FAQs

Course Hive
Download CourseHive
Keep learning anywhere