This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function convertToBase(uint N, uint8 base) public returns (uint) { | |
if (N <= 0) return 0; | |
uint index = 0; | |
uint converted = 0; | |
while (N >= base) { | |
uint remainder = N % base; | |
N = N / base; | |
converted += remainder * (10** index++); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a serverless project for Node.js within AWS Lambda | |
serverless create --template aws-nodejs | |
# Create AWS credentials file in ~/.aws | |
serverless config credentials --provider aws --key <access-key-id> --secret <secret> --profile <profilename> | |
# Deploy functions from serverless.yml to AWS Lambda | |
sls deploy | |
# Invoke function |