1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Flutter] flutter base64encode hash

Discussão em 'Mobile' iniciado por Stack, Outubro 10, 2024 às 07:22.

  1. Stack

    Stack Membro Participativo

    I have a sha256 hash which is 5d753fd209b8cb9dff6801edbc60f2fdc00abff56bf3ef8c0f7cf9b975a2a1f9

    and i know what i should get at the end which is this base64 encoded String N7m2mKF7vY8tM8PVvkPONqnu5gdXWPm+vcT3lkpBWZ8=

    but can't figure out how to get this. Just now i have tryed this

    var hexString = '5d753fd209b8cb9dff6801edbc60f2fdc00abff56bf3ef8c0f7cf9b975a2a1f9';
    var hexArray = HexUtils.decode(hexString);
    var base64String = base64Encode(hexArray);
    print('base64String: $base64String');


    which print's to the console

    XXU/0gm4y53/aAHtvGDy/cAKv/Vr8++MD3z5uXWiofk=

    what is not what i want. It should give me

    N7m2mKF7vY8tM8PVvkPONqnu5gdXWPm+vcT3lkpBWZ8=

    Any help is very much appreciated. Thank you so much.

    I use the package basic_utils for HexUtils.decode and dart:convert for base64Encode

    Continue reading...

Compartilhe esta Página