Skip to content

Commit

Permalink
Several changes towards new release 0.3.1, new maintainer
Browse files Browse the repository at this point in the history
  • Loading branch information
eddelbuettel committed Mar 31, 2024
1 parent d9a1171 commit 7100584
Show file tree
Hide file tree
Showing 31 changed files with 357 additions and 706 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@
^cran-comments\.md$
^CRAN-RELEASE$
^CODE_OF_CONDUCT\.md$
^.editorconfig
^.github
1 change: 0 additions & 1 deletion .codecov.yml

This file was deleted.

20 changes: 20 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# EditorConfig is awesome: http://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

# Matches multiple files with brace expansion notation
# 4 space indentation
[*.{c,cpp,h,hpp,R,r}]
indent_style = space
indent_size = 4

# Tab indentation (no size specified)
[Makefile]
indent_style = tab
40 changes: 40 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Run CI for R using https://eddelbuettel.github.io/r-ci/

name: ci

on:
push:
pull_request:

env:
_R_CHECK_FORCE_SUGGESTS_: "false"

jobs:
ci:
strategy:
matrix:
include:
#- {os: macOS-latest}
- {os: ubuntu-latest}

runs-on: ${{ matrix.os }}

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup
uses: eddelbuettel/github-actions/r-ci-setup@master

- name: Bootstrap
run: ./run.sh bootstrap

- name: Dependencies
run: ./run.sh install_deps

- name: Test
run: ./run.sh run_tests

#- name: Coverage
# if: ${{ matrix.os == 'ubuntu-latest' }}
# run: ./run.sh coverage
25 changes: 0 additions & 25 deletions CODE_OF_CONDUCT.md

This file was deleted.

2 changes: 0 additions & 2 deletions CRAN-RELEASE

This file was deleted.

7 changes: 7 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
2024-03-31 Dirk Eddelbuettel <[email protected]>

* DESCRIPTION (Authors@R): New maintainer

* *: A number of files have been removed making the package smaller
and lighter, a few URLs have been updated to the new repo, manual
pages have been aligned, new alias ulid() added
60 changes: 25 additions & 35 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,42 +1,32 @@
Package: ulid
Type: Package
Title: Generate Universally Unique Lexicographically Sortable Identifiers
Version: 0.3.0
Date: 2019-07-04
Authors@R: c( person("Bob", "Rudis", email = "[email protected]", role =
c("aut", "cre"), comment = c(ORCID = "0000-0001-5670-2640")),
person("suyash", role = c("aut"), comment = "ULID C++ Port
<https://github.com/suyash/ulid/>") )
Maintainer: Bob Rudis <[email protected]>
Description: Universally unique identifiers ('UUIDs') can be suboptimal
for many uses-cases because they aren't the most character
efficient way of encoding 128 bits of randomness; v1/v2 versions
are impractical in many environments, as they require access to a
unique, stable MAC address; v3/v5 versions require a unique seed
and produce randomly distributed IDs, which can cause
fragmentation in many data structures; v4 provides no other
information than randomness which can cause fragmentation in many
data structures. 'ULIDs' (<https://github.com/ulid/spec>) have
128-bit compatibility with 'UUID', 1.21e+24 unique 'ULIDs' per
millisecond, are lexicographically sortable, canonically encoded
as a 26 character string, as opposed to the 36 character 'UUID',
use Crockford's 'base32' for better efficiency and readability (5
bits per character), are case insensitive, have no special
characters (i.e. are 'URL' safe) and have a onotonic sort order
(correctly detects and handles the same millisecond).
URL: https://gitlab.com/hrbrmstr/ulid
BugReports: https://gitlab.com/hrbrmstr/ulid/issues
SystemRequirements: C++11
Title: Generate Universally Unique 'Lexicographically' 'Sortable' Identifiers
Version: 0.3.0.1
Date: 2024-03-31
Authors@R: c(
person("Bob", "Rudis", role = "aut", comment = c(ORCID = "0000-0001-5670-2640")),
person("Suyash", "Verma", role = "aut", comment = "ULID C++ <https://github.com/suyash/ulid/>"),
person("Dirk", "Eddelbuettel", role = "cre", comment = c(ORCID = "0000-0001-6419-907X"),
email = "[email protected]"))
Description: Universally unique identifiers ('UUIDs') can be sub-optimal for many
uses-cases because they are not the most character efficient way of encoding
128 bits of randomness; v1/v2 versions are impractical in many environments,
as they require access to a unique, stable MAC address; v3/v5 versions require
a unique seed and produce randomly distributed IDs, which can cause fragmentation
in many data structures; v4 provides no other information than randomness which
can cause fragmentation in many data structures. Providing an alternative, 'ULIDs'
(<https://github.com/ulid/spec>) have 128-bit compatibility with 'UUID', 1.21e+24
unique 'ULIDs' per millisecond, support standard (text) sorting, canonically encoded
as a 26 character string, as opposed to the 36 character 'UUID', use 'base32'
encoding for better efficiency and readability (5 bits per character), are case
insensitive, have no special characters (i.e. are 'URL' safe) and have a monotonic
sort order (correctly detects and handles the same millisecond).
URL: https://github.com/eddelbuettel/ulid
BugReports: https://github.com/eddelbuettel/ulid/issues
NeedsCompilation: yes
Encoding: UTF-8
License: MIT + file LICENSE
Suggests:
covr,
tinytest,
knitr,
rmarkdown
Depends: R (>= 3.2.0)
Suggests: tinytest
Imports: Rcpp
RoxygenNote: 6.1.1
LinkingTo: Rcpp
VignetteBuilder: knitr
RoxygenNote: 7.3.1
21 changes: 0 additions & 21 deletions LICENSE.md

This file was deleted.

3 changes: 2 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
export(ULIDgenerate)
export(generate)
export(ts_generate)
export(ulid)
export(ulid_generate)
export(unmarshal)
importFrom(Rcpp,sourceCpp)
importFrom(Rcpp,evalCpp)
useDynLib(ulid, .registration = TRUE)
11 changes: 0 additions & 11 deletions NEWS.md

This file was deleted.

42 changes: 23 additions & 19 deletions R/RcppExports.R
Original file line number Diff line number Diff line change
@@ -1,44 +1,48 @@
# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

#' Generate ULIDs from timestamps
#'
#' This function generates a new [Universally Unique Lexicographically
#' Sortable Identifier](https://github.com/ulid/spec) from a vector of
#' `POSIXct` timestamps.
#'
#' @md
#' @param tsv vector of `POSIXct` values
#' @export
#' @examples
#' ts_generate(as.POSIXct("2017-11-01 15:00:00", origin="1970-01-01"))
ts_generate <- function(tsv) {
.Call(`_ulid_ts_generate`, tsv)
}

#' Generate ULID
#'
#' [ULIDgenerate()] generates a new [Universally Unique Lexicographically
#' Sortable Identifier](https://github.com/ulid/spec).
#' [generate()] generates a new [Universally Unique Lexicographically
#' Sortable Identifier](https://github.com/ulid/spec). Several aliases are
#' available for convience and backwards-compatibility.
#'
#' @md
#' @param n number of id's to generate (default = `1`)
#' @rdname ulid
#' @export
#' @examples
#' ULIDgenerate()
ULIDgenerate <- function(n = 1L) {
.Call(`_ulid_ULIDgenerate`, n)
generate <- function(n = 1L) {
.Call(`_ulid_generate`, n)
}

#' Unmarshal a ULID into a data frame with timestamp and random bitstring columns
#'
#' @md
#' @param ulids character ULIDs (e.g. created with [ULIDgenerate()])
#' @export
#' @rdname ulid
#' @return data frame (tibble)
#' @examples
#' unmarshal(ULIDgenerate())
unmarshal <- function(ulids) {
.Call(`_ulid_unmarshal`, ulids)
}

#' Generate ULIDs from timestamps
#'
#' This function generates a new [Universally Unique Lexicographically
#' Sortable Identifier](https://github.com/ulid/spec) from a vector of
#' `POSIXct` timestamps.
#'
#' @md
#' @param tsv vector of `POSIXct` values
#' @export
#' @rdname ulid
#' @examples
#' ts_generate(as.POSIXct("2017-11-01 15:00:00", origin="1970-01-01"))
ts_generate <- function(tsv) {
.Call(`_ulid_ts_generate`, tsv)
}

7 changes: 0 additions & 7 deletions R/gen.R

This file was deleted.

36 changes: 26 additions & 10 deletions R/ulid-package.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#' @title
#' Generate Universally Unique Lexicographically Sortable Identifiers
#'
#' (grifted from <https://github.com/ulid/spec>)
#' @description
#' As described in the [ulid specification repo](https://github.com/ulid/spec), and slightly edited here,
#' UUID use can be suboptimal for many uses-cases because:(grifted from <https://github.com/ulid/spec>)
#'
#' UUID can be suboptimal for many uses-cases because:
#'
Expand All @@ -9,12 +12,14 @@
#' - UUID v3/v5 requires a unique seed and produces randomly distributed IDs, which can cause fragmentation in many data structures
#' - UUID v4 provides no other information than randomness which can cause fragmentation in many data structures
#'
#' Instead, herein is proposed ULID:
#' Instead, an alternative is proposed in ULID:
#'
#' ```
#' ulid() // 01ARZ3NDEKTSV4RRFFQ69G5FAV
#' ```
#'
#' with the following properties:
#'
#' - 128-bit compatibility with UUID
#' - 1.21e+24 unique ULIDs per millisecond
#' - Lexicographically sortable!
Expand All @@ -37,7 +42,7 @@
#' _Timestamp_
#' - 48 bit integer
#' - UNIX-time in milliseconds
#' - Won't run out of space till the year 10889 AD.
#' - Will not run out of space until the year 10889 AD.
#'
#' _Randomness_
#' - 80 bits
Expand All @@ -48,13 +53,24 @@
#' The left-most character must be sorted first, and the right-most character sorted last (lexical order).
#' The default ASCII character set must be used. Within the same millisecond, sort order is not guaranteed.
#'
#' - URL: <https://gitlab.com/hrbrmstr/ulid>
#' - BugReports: <https://gitlab.com/hrbrmstr/ulid/issues>
#'
#' @md
#' @name ulid
#' @docType package
#' @author Bob Rudis (bob@@rud.is)
#' @author Bob Rudis (bob@@rud.is) wrote the package based on `ulid` C++ library by Suyash Verma.
#'
#' Dirk Eddelbuettel now maintains the package.
#' @useDynLib ulid, .registration = TRUE
#' @importFrom Rcpp sourceCpp
NULL
#' @importFrom Rcpp evalCpp
#' @seealso The [ulid specification](https://github.com/ulid/spec) provides the reference.
"_PACKAGE"

#' @rdname ulid
#' @export
ulid <- generate

#' @rdname ulid
#' @export
ulid_generate <- generate

#' @rdname ulid
#' @export
ULIDgenerate <- generate
Loading

0 comments on commit 7100584

Please sign in to comment.