PHP uses recursion to integrate its two-dimensional array into a hierarchical tree, where the hierarchical id is in a uuid format. The weird problem has been solved.

No more verbosity, just go directly to the source code. <?php function findChildren($list, $p_id){ $r = array(); foreach ($list as $k => $item) { if ($item[‘fid’] == $p_id) { unset($list[$k]); $length = count($r); $r[$length] = $item; if ($t = findChildren($list, $item[‘id’])) { $r[$length][‘children’] = $t; } } } return $r; } function findChildren2($list,$p_id, & amp;$sike=[]) […]

SpringBoot logback log printing adds trace_uuid tracking interface request output log (including thread pool unified configuration)

In order to facilitate project log query, you can add a custom identifier to the log configuration file and add a uuid to the log header to achieve the purpose of adding a unique identifier for the same interface request identifier. Here’s a simple way: 1. By looking at the slf4j source code comments, the […]

Implementation of redemption coupons (UUID, snowflake algorithm, self-increasing id)

Make a request: Algorithm Analysis UUID Advantages: unique, highly random, 32-bit hexadecimal, not bad in readability Disadvantages: takes up too much memory (32*16=128 bits), uncontrollable Snowflake algorithm: Advantages: Globally unique, suitable for distributed systems, high generation efficiency, ID is a number and easy to understand Disadvantages: Not suitable for situations that require high readability, and […]

Disadvantages of UUID and Snowflake Algorithm

question General universal solution snowflake algorithm picture Foreword The unique system ID is a problem we often encounter when designing a system, and we often struggle with this problem. This article is to provide you with an idea for generating a distributed unique global ID generation solution. I hope it can help you. If there […]

MyBatisPlus (14) Primary key strategy (snowflake algorithm + UUID + primary key auto-increment + user input)

Description MyBatis Plus integrates a variety of primary key strategies to help users quickly generate primary keys. Snowflake algorithm ID (default strategy) (recommended) UUID Auto-increment ID The user enters the ID (the user must manually pass in the ID every time he inserts data) Snowflake algorithm ID: IdType.ASSIGN_ID (recommended) By default, the snowflake algorithm ID […]

Anti-kill confrontation-memory loading-shellcode conversion-UUID+MAC+IPV4

Memory Loading-UUIDAddress-ShellCodeConversion Introduction: Universal Unique Identification Code (UUID) is a 128-bit identifier used in computer systems to identify the number of information. It is generated according to standard methods and does not rely on registration and distribution by a central agency. UUID is unique. Demo language: c++ 1. Use the following code to convert the […]

Get the UUID of the virtual machine in VC from vROPS

The ID of the virtual machine object in vROPS is resourceID, which is inconsistent with the UUID of the virtual machine in vCenter. Therefore, if you want to match the virtual machine in vROPS with the virtual machine in vCenter, you must not rely on the virtual machine name, but must rely on the UUID. […]

Sorry, the UUID should have been changed long ago!

ULID: Universally Unique Lexicographically Sortable Identifier (Universally Unique Lexicographically Sortable Identifier) UUID: Universally Unique Identifier (Universally Unique Identifier) Why not choose UUID UUID currently has 5 versions: Version 1: Impractical in many environments because it requires access to unique, Stable MAC address, easy to be attacked; Version 2: Replace the first four digits of the […]

Android: Get MAC < Android 11 <= Get UUID

1. Core code MainUseMac.java import android.annotation.SuppressLint; import android.content.Context; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.net.wifi.WifiInfo; import android.net.wifi.WifiManager; import android.os.Environment; import android.util.Log; import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.net.NetworkInterface; import java.util.Collections; import java.util.List; import java.util.UUID; public class UseMac { public static final String main(Context context) { //R corresponds to Android […]

Boost Development Guide-4.10uuid

uuid The uuid library is a small utility that can represent and generate UUIDs. UUID is the abbreviation of Universally Unique Identifier. Another alias is GUID, which is a 128-bit number (16 bytes) that can create a globally unique identifier without a central certification authority. For example, “E4A0D7CE-9E6D-4E74-9E6D-7E749E6D7E74” is a UUID. UUID can be used […]