/
vasiukoff
/
sg
Обзор
Документация
Войти
/
vasiukoff
/
sg
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/Models/LFSObject.cs
22 строки
686 B
leo
refactor: rewrite lfs pointer detection and image loading
05 июн 2025, 16:06
05 июн 2025, 16:06
a023a92
Код
Авторство
О чём код?
using System.Text.RegularExpressions; namespace SourceGit.Models { public partial class LFSObject { [GeneratedRegex(@"^version https://git-lfs.github.com/spec/v\d+\r?\noid sha256:([0-9a-f]+)\r?\nsize (\d+)[\r\n]*$")] private static partial Regex REG_FORMAT(); public string Oid { get; set; } = string.Empty; public long Size { get; set; } = 0; public static LFSObject Parse(string content) { var match = REG_FORMAT().Match(content); if (match.Success) return new() { Oid = match.Groups[1].Value, Size = long.Parse(match.Groups[2].Value) }; return null; } } }