sha256_test.c
Go to the documentation of this file.
00001 /*
00002   simple test of mavlink sha256 code. 
00003  */
00004 #include <stdio.h>
00005 #include <stdint.h>
00006 #include <string.h>
00007 
00008 #include <mavlink_sha256.h>
00009 
00010 int main(int argc, const char *argv[])
00011 {
00012     mavlink_sha256_ctx ctx;
00013     uint8_t result[6];
00014     uint8_t i;
00015     
00016     mavlink_sha256_init(&ctx);
00017     mavlink_sha256_update(&ctx, argv[1], strlen(argv[1]));
00018     mavlink_sha256_final_48(&ctx, result);
00019     for (i=0; i<6; i++) {
00020         printf("%02x ", (unsigned)result[i]);
00021     }
00022     printf("\n");
00023     return 0;
00024 }


mavlink
Author(s): Lorenz Meier
autogenerated on Thu Jun 6 2019 19:01:57