This file contains 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
#include <cstdio> | |
#include <list> | |
#include <vector> | |
#include "zip.h" | |
int main() { | |
std::vector<int> one{{1, 11}}; | |
auto two = [] { return std::vector<short>{{2, 22}}; }; | |
const std::list<float> three{{3, 33}}; |
This file contains 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
var alphabet = "123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"; | |
var base = alphabet.length; // base is the length of the alphabet (58 in this case) | |
// utility function to convert base 10 integer to base 58 string | |
function encode(num) { | |
var encoded = ''; | |
while (num){ | |
var remainder = num % base; | |
num = Math.floor(num / base); | |
encoded = alphabet[remainder].toString() + encoded; |