Giter VIP home page Giter VIP logo

simpletotp's Introduction

simpleTOTP

A minimal implementation of the TOTP and HOTP algorithms.

Dependencies

  • C99-compliant C compiler
  • OpenSSL
  • (optional) GNU Make

Building

Run make to compile simpleTOTP.o and run a simple test suite.

Licence

MIT, see LICENCE file for full text.

simpletotp's People

Stargazers

hageking avatar  avatar

Watchers

James Cloos avatar

simpletotp's Issues

4 compile errors

Your project is very good.
But, your project is 4 errors.
These are my compile errors.

test.cpp:8:21: error: cannot initialize an array element of type 'uint8_t *' (aka 'unsigned char *') with an lvalue of type 'const char[21]'
        uint8_t* keys[] = {"12345678901234567890"};
                           ^~~~~~~~~~~~~~~~~~~~~~
test.cpp:15:29: error: invalid application of 'sizeof' to an incomplete type 'uint8_t *[]'
        uint32_t solutions[][sizeof(keys) / sizeof(keys[0])] =
                                   ^~~~~~
test.cpp:24:28: error: invalid application of 'sizeof' to an incomplete type 'uint8_t *[]'
        for (int i = 0; i < sizeof(keys) / sizeof(keys[0]); ++i)
                                  ^~~~~~
test.cpp:28:34: error: no matching function for call to 'strlen'
                        int32_t token = totp(keys[i], strlen(keys[i]), times[j], 8);
                                                      ^~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/string.h:82:9: note: candidate function not viable: no known conversion from 'uint8_t *' (aka 'unsigned char *') to 'const char *' for 1st argument
size_t   strlen(const char *__s);

How can I fix them?

Environment
ProductName : macOS
ProductVersion : 13.1
BuildVersion : 22C65
command : g++ -std=c++20 test.cpp

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.