Fun 0.41.5
The programming language that makes You have fun
Loading...
Searching...
No Matches
sha512.c
Go to the documentation of this file.
1/*
2 * This file is part of the Fun programming language.
3 * https://fun-lang.xyz/
4 *
5 * Copyright 2026 Johannes Findeisen <you@hanez.org>
6 * Licensed under the terms of the Apache-2.0 license.
7 * https://opensource.org/license/apache-2-0
8 */
9
28
30 Value vdata = pop_value(vm);
31 char *s = value_to_string_alloc(&vdata);
32 free_value(vdata);
33 if (!s) {
34 push_value(vm, make_string(""));
35 break;
36 }
37 char *hex = fun_openssl_sha512_hex((const unsigned char *)s, strlen(s));
39 if (!hex) {
40 push_value(vm, make_string(""));
41 break;
42 }
46 break;
47}
Value out
Definition apop.c:38
@ OP_OPENSSL_SHA512
Definition bytecode.h:199
char * hex
Definition md5.c:39
uint32_t s
Definition rol.c:31
free_value(vdata)
free(s)
push_value(vm, out)
Tagged union representing a Fun value.
Definition value.h:68
Value make_string(const char *s)
Construct a string Value by duplicating the given C string.
Definition value.c:95
char * value_to_string_alloc(const Value *v)
Allocate a printable C string for a Value.
Definition value.c:641