Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a23c75b7 authored by Simon Shields's avatar Simon Shields Committed by Tim Schumacher
Browse files

Settings: CMStats: use sha256 for device IDs

Collions may occur with MD5.

[backport to cm-11.0: Added Copyright]

Change-Id: Ie003e6b1b900b32f0a0092aec4e70bff5fe18dec
parent 9422ec6e
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
/*
 * Copyright (C) 2012 The CyanogenMod Project
 * Copyright (C) 2017 The LineageOS Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
@@ -69,7 +70,7 @@ public class Utilities {

    public static String digest(String input) {
        try {
            MessageDigest md = MessageDigest.getInstance("MD5");
            MessageDigest md = MessageDigest.getInstance("SHA-256");
            return new BigInteger(1, md.digest(input.getBytes())).toString(16).toUpperCase();
        } catch (Exception e) {
            return null;