MCPcopy
hub / github.com/faker-js/faker / commitSha

Method commitSha

src/modules/git/index.ts:203–219  ·  view source on GitHub ↗

* Generates a random commit sha. * * By default, the length of the commit sha is 40 characters. * * For a shorter commit sha, use the `length` option. * * Usual short commit sha length is: * - 7 for GitHub * - 8 for GitLab * * @param options Options for the commit sha.

(
    options: {
      /**
       * The length of the commit sha.
       *
       * @default 40
       */
      length?: number;
    } = {}
  )

Source from the content-addressed store, hash-verified

201 * @since 5.0.0
202 */
203 commitSha(
204 options: {
205 /**
206 * The length of the commit sha.
207 *
208 * @default 40
209 */
210 length?: number;
211 } = {}
212 ): string {
213 const { length = 40 } = options;
214 return this.faker.string.hexadecimal({
215 length,
216 casing: 'lower',
217 prefix: '',
218 });
219 }
220}

Callers 2

commitEntryMethod · 0.95
git.spec.tsFile · 0.80

Calls 1

hexadecimalMethod · 0.80

Tested by

no test coverage detected