Sha256: 0a927b4ffcd086e0b97d34e29255aaab5076a4f11deac3b0f105eaeafa7f47fc

Contents?: true

Size: 505 Bytes

Versions: 1

Compression:

Stored size: 505 Bytes

Contents

package org.embulk.output.snowflake;

import java.util.Random;

public class SnowflakeUtils {
    public static final String SOURCES =
            "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890";

    public static String randomString(int length){
        Random rand = new Random();
        char[] text = new char[length];
        for (int i = 0; i < length; i++) {
            text[i] = SOURCES.charAt(rand.nextInt(SOURCES.length()));
        }
        return new String(text);
    }
}

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
embulk-output-snowflake-0.2.0 src/main/java/org/embulk/output/snowflake/SnowflakeUtils.java